package com.gary.domain;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author pengrui
 * @date 2020/11/13 - 13:45
 *  注： 使用@configurationProperties 注解引入配置文件时 字段名必须实现set方法，否则无法将数据设置到对象中
 */
@Component
@ConfigurationProperties("dog")
public class Dog {
    private String name;
    private Integer age;
    private String master;

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public void setMaster(String master) {
        this.master = master;
    }

    @Override
    public String toString() {
        return "Dog{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", master='" + master + '\'' +
                '}';
    }
}
